package _tema3;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.GridLayout;
import javax.swing.BorderFactory;
import javax.swing.DefaultListModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

public class Ventana extends JFrame {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	final int PORT = 7900;
	final String ADDRESS = "127.0.0.1";
	JComboBox combo;
	JList display;
	JButton login, logout, exit;
	DefaultListModel model;
	Cliente cliente;
    
    public Ventana() {
    	super("Tema3");
    	setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
		configurar();
    }
    
	
    private void configurar() {
    	Container c = getContentPane();
    	
    	JPanel pnlNor = new JPanel();
    	pnlNor.setLayout(new GridLayout(1,2,5,5));
    	pnlNor.setBorder(BorderFactory.createEmptyBorder(4,4,4,4));
    	c.add(pnlNor, BorderLayout.NORTH); 
    	
    	JLabel lblJugador = new JLabel("Cargos o Funciones:");
    	pnlNor.add(lblJugador);
    	
    	combo = new JComboBox();
    	combo.setPreferredSize(new Dimension(120,18));
     	pnlNor.add(combo);    	
    	
    	model = new DefaultListModel();
      	display = new JList(model);
     	JScrollPane jsp = new JScrollPane(display);
    	c.add(jsp, BorderLayout.CENTER);
    	
    	JPanel pnlSur = new JPanel();
    	pnlSur.setLayout(new GridLayout(1,3,4,2));
    	pnlSur.setBorder(BorderFactory.createEtchedBorder());
    	c.add(pnlSur, BorderLayout.SOUTH);  
    	
    	login = new JButton("Conectar");
    	logout = new JButton("Desconectar");
    	logout.setSelected(true);
    	exit = new JButton("Finalizar");
    	exit.setSelected(true);
  	    	
        pnlSur.add(login);
        pnlSur.add(logout);
        pnlSur.add(exit);
        
        setLocation(420,100);
        pack();
    }
}
